package autoteam.ui.tabs;

import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import autoteam.League;

public class DraftsTab extends JTabbedPane
{   
    private static final long serialVersionUID = 6546854064491571548L;
	private JFrame owner;
	private League doc;

	public DraftsTab(JFrame parentFrame) // for testing purposes only
	{
		super();
		owner = parentFrame;
		createTabs();
		
		this.setPreferredSize( new Dimension(600,400) );
		this.setSize( new Dimension(600,400) );
	}

	public DraftsTab(League _doc, JFrame parentFrame)
	{
		super();
		doc = _doc;
		owner = parentFrame;
		createTabs(_doc);
	}
	
	private void createTabs()
	{
		this.addTab("Draft Teams", new JPanel());
		this.addTab("Draft by Type", new JPanel());
		this.addTab("Draft Report", new JPanel());	
		this.setSelectedIndex(0);
		this.setOpaque(true);
	}

	private void createTabs(League doc)
	{
		this.addTab("Draft Teams", new DraftTeamsTab(doc) );
		this.addTab("Draft by Type", new DraftTypeTab(doc) );
		this.addTab("Draft Report", new DraftReportTab(doc) );
	}
	
	public void setParentFrame(JFrame frame)
	{
		owner = frame;
	}
	
	public static void main(String[] args)
	{
		JFrame frame = new JFrame("Tab Testing");

		DraftsTab testTabs = new DraftsTab(frame);

		frame.add(testTabs);
		frame.setSize(testTabs.getPreferredSize());
		frame.setVisible(true);
	}
	
}
